package com.books.enums;

import lombok.Data;


public enum BookStatusEnum {
    DELETE(0,"删除"),
    NORMAL(1,"正常"),
    FORNIDDEN(2,"不允许借阅");

private Integer code;
private String desc;

    BookStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    public static BookStatusEnum getBookInfoStatusCNByStatus(Integer status){
        switch (status){
            case 0:return BookStatusEnum.DELETE;
            case 1:return BookStatusEnum.NORMAL;
            case 2:return BookStatusEnum.FORNIDDEN;
            default:return null;
        }
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
